package com.hrzyit.whistle.user.data.api

import com.hrzyit.base.data.protocol.BaseResp
import com.hrzyit.whistle.user.data.bean.UserInfo
import com.hrzyit.whistle.user.data.protocol.ForgetPwdReq
import com.hrzyit.whistle.user.data.protocol.LoginReq
import com.hrzyit.whistle.user.data.protocol.ResetPwdReq
import retrofit2.http.Body
import retrofit2.http.POST
//import rx.Observable
import io.reactivex.Observable

/**
 * 用户相关操作接口
 * @author YangWei
 * @date 2019/3/22
 */
interface UserApi {

    /**
     * 用户登录
     * <p>
     *     http://ip:port/api/auth/login
     * </p>
     * @return BaseResp<UserInfo><UserInfo>
     */
    @POST("api/auth/login")
    fun login(@Body req: LoginReq): Observable<BaseResp<UserInfo>>

    /**
     * 忘记密码
     * <p>
     *     http://ip:port/api/user/forgetPwd
     * </p>
     * @return BaseResp<Boolean><UserInfo>
     */
    @POST("api/user/forgetPwd")
    fun forgetPwd(@Body req: ForgetPwdReq): Observable<BaseResp<Boolean>>

    /**
     * 重置密码
     * <p>
     *     http://ip:port/api/user/resetPwd
     * </p>
     * @return BaseResp<UserInfo><UserInfo>
     */
    fun resetPwd(@Body req: ResetPwdReq): Observable<BaseResp<UserInfo>>
}